package com.billy.ohos.swipe.demo;

import com.billy.ohos.swipe.PointF;
import com.billy.ohos.swipe.consumer.StayConsumer;
import com.billy.ohos.swipe.internal.SwipeHelper;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.agp.components.Component;
import ohos.agp.components.ComponentContainer;
import ohos.app.Context;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * 单元测试
 */
public class ExampleOhosTest {
    private Context context;
    private StayConsumer stayConsumer;

    /**
     * 前置初始化对象
     */
    @Before
    public void setUp() {
        context = AbilityDelegatorRegistry.getAbilityDelegator().getAppContext();
        stayConsumer = new StayConsumer();
    }

    /**
     * 测试上下文
     */
    @Test
    public void testContext() {
        Assert.assertNotNull(context);
    }

    /**
     * 测试StayConsumer
     */
    @Test
    public void  testStayConsumerSetMinVelocity(){
        int velocity = 100;
        stayConsumer.setMinVelocity(velocity);
        Assert.assertNotNull(stayConsumer.getMinVelocity());
    }
}
